package version1.part2.common.service.serviceImpl;

import version1.part1.common.pojo.User;
import version1.part1.common.service.UserService;

import java.util.Random;
import java.util.UUID;

/**
 * @author Stone
 * @version 1.0.1
 * @date 2025/9/16
 */
public class UserServiceImpl implements UserService {
    @Override
    public User getUserByUserId(Integer id) {
        System.out.println("客户端查询了"+id+"的用户");
        Random random = new Random();
        return User.builder().userName(UUID.randomUUID().toString())
                .id(id)
                .sex(random.nextBoolean()).build();
    }

    @Override
    public Integer insertUserId(User user) {
        System.out.println("插入数据成功"+user.getUserName());
        return user.getId();
    }
}
